﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;

namespace YArchitech.Revit
{
	public class ConnectorPositionEquality : IEqualityComparer<Connector>
	{
		public bool Equals(Connector c1, Connector c2)
		{
			return c1.Origin.IsAlmostEqualTo(c2.Origin, RevitElementExtension.PointEqualTol);
		}

		public int GetHashCode(Connector obj)
		{
			if (obj != null)
			{
				return obj.ToString().GetHashCode();
			}
			return 0;
		}
	}
}
